namespace TenantManagementService.Monitoring
{
    /// <summary>
    /// 监控指标常量定义
    /// </summary>
    public static class MetricConstants
    {
        /// <summary>
        /// 租户相关指标
        /// </summary>
        public static class Tenant
        {
            /// <summary>
            /// 租户总数
            /// </summary>
            public const string TotalCount = "tenant_total_count";

            /// <summary>
            /// 活跃租户数
            /// </summary>
            public const string ActiveCount = "tenant_active_count";

            /// <summary>
            /// 暂停租户数
            /// </summary>
            public const string SuspendedCount = "tenant_suspended_count";

            /// <summary>
            /// 过期租户数
            /// </summary>
            public const string ExpiredCount = "tenant_expired_count";

            /// <summary>
            /// 租户用户总数
            /// </summary>
            public const string UserCount = "tenant_user_count";

            /// <summary>
            /// 租户用户使用率
            /// </summary>
            public const string UserUsagePercentage = "tenant_user_usage_percentage";

            /// <summary>
            /// 租户存储使用量
            /// </summary>
            public const string StorageUsage = "tenant_storage_usage";

            /// <summary>
            /// 租户存储使用率
            /// </summary>
            public const string StorageUsagePercentage = "tenant_storage_usage_percentage";

            /// <summary>
            /// 租户API调用次数
            /// </summary>
            public const string ApiCallCount = "tenant_api_call_count";

            /// <summary>
            /// 租户API响应时间
            /// </summary>
            public const string ApiResponseTime = "tenant_api_response_time";

            /// <summary>
            /// 租户API错误率
            /// </summary>
            public const string ApiErrorRate = "tenant_api_error_rate";
        }

        /// <summary>
        /// 系统相关指标
        /// </summary>
        public static class System
        {
            /// <summary>
            /// CPU使用率
            /// </summary>
            public const string CpuUsage = "system_cpu_usage";

            /// <summary>
            /// 内存使用率
            /// </summary>
            public const string MemoryUsage = "system_memory_usage";

            /// <summary>
            /// 磁盘使用率
            /// </summary>
            public const string DiskUsage = "system_disk_usage";

            /// <summary>
            /// 网络IO
            /// </summary>
            public const string NetworkIO = "system_network_io";

            /// <summary>
            /// 数据库连接数
            /// </summary>
            public const string DatabaseConnectionCount = "system_database_connection_count";

            /// <summary>
            /// 缓存命中率
            /// </summary>
            public const string CacheHitRate = "system_cache_hit_rate";
        }

        /// <summary>
        /// 业务相关指标
        /// </summary>
        public static class Business
        {
            /// <summary>
            /// 新增租户数
            /// </summary>
            public const string NewTenantsCount = "business_new_tenants_count";

            /// <summary>
            /// 删除租户数
            /// </summary>
            public const string DeletedTenantsCount = "business_deleted_tenants_count";

            /// <summary>
            /// 租户续费次数
            /// </summary>
            public const string TenantRenewalCount = "business_tenant_renewal_count";

            /// <summary>
            /// 试用转正式数量
            /// </summary>
            public const string TrialToPaidCount = "business_trial_to_paid_count";
        }
    }

    /// <summary>
    /// 告警规则常量定义
    /// </summary>
    public static class AlertConstants
    {
        /// <summary>
        /// 租户用户数超限告警
        /// </summary>
        public const string TenantUserLimitExceeded = "tenant_user_limit_exceeded";

        /// <summary>
        /// 租户存储超限告警
        /// </summary>
        public const string TenantStorageLimitExceeded = "tenant_storage_limit_exceeded";

        /// <summary>
        /// 租户即将过期告警
        /// </summary>
        public const string TenantExpirationWarning = "tenant_expiration_warning";

        /// <summary>
        /// 租户已过期告警
        /// </summary>
        public const string TenantExpired = "tenant_expired";

        /// <summary>
        /// 系统资源使用率告警
        /// </summary>
        public const string SystemResourceUsage = "system_resource_usage";

        /// <summary>
        /// API错误率告警
        /// </summary>
        public const string ApiErrorRateHigh = "api_error_rate_high";

        /// <summary>
        /// API响应时间告警
        /// </summary>
        public const string ApiResponseTimeHigh = "api_response_time_high";
    }
}